package com.job.sun.HomeWork0707;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-08 17:49:28
 */
public class Teacher {
    public String name="小王";
    public int age=20;
    {
        this.name="老王";
        System.out.println("类代码块执行");
    }
    static {
        System.out.println("静态代码块执行");
    }

    public Teacher() {
        System.out.println("无参构造执行了");
    }

    public Teacher(String name) {
        System.out.println("有参构造执行了");
        this.name = name;
    }

    public Teacher(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("有参构造执行了");
    }
}